package edu.zut.process;

public class Demo5 {

    public static void main(String[] args) {
        /*
        int i = 1;
        while (i <= 10){
            System.out.println(i);
            i ++;
        }
        */
        /**
         * for(初始化表达式; 循环判断 ; 迭代){
         *     循环体;
         * }
         * for( ; ;)两个;号必不可少
         *
         */
        for (int j = 1; j <= 10; j++) {
            System.out.print(j + " ");
        }
        System.out.println("----------------1-10阶乘------------------");
        //1 - 10的阶乘
//        int k,m= 1;
        int factorial = 1; //每次得到的阶乘结果
        for (int i = 1; i <= 10; i++) {
            factorial = i * factorial;
        }
        System.out.println("factorial = " + factorial);

    }
}
